﻿namespace Google.Translates.Core
{
    public class ApiSetting
    {
        private static int m_TotalObjectAmount;

        private static readonly string[] m_AppIds = new[]
                                                        {
                                                            "AIzaSyB3SVFyzNrLeoUvp-6WXwOIV1iGEj_SwE0",
                                                            "AIzaSyBiJsKdJzN4r8sYRfvY4A4ErmcCR7gBAdc"
                                                        };

        public static string GetGoogleTranslateAppId()
        {
            string reVal = "";
            m_TotalObjectAmount++;
            if (m_AppIds.Length > 1)
            {
                int index = m_TotalObjectAmount%m_AppIds.Length;
                reVal = m_AppIds[index];
            }
            else if (m_AppIds.Length == 1)
                reVal = m_AppIds[0];
            return reVal;
        }

        public static string GetGoogleTranslateAppId(int appIdIndex)
        {
            return m_AppIds.Length > appIdIndex ? m_AppIds[appIdIndex] : m_AppIds[0];
        }

        public static string GetBingTranslateAppId()
        {
            return "C1D1CDEB53FDFCC57E7F911E872CD85B0ACF46E3";
        }
    }
}